import req from '@/utils/request';

// 一级联动 接口: /admin/product/getCategory1
export const reqCategory1List = () => req.get('/admin/product/getCategory1')

// 一级联动 接口: /admin/product/getCategory1
export const reqCategory2List = (category1Id) => req.get(`/admin/product/getCategory2/${category1Id}`)

// 一级联动 接口: /admin/product/getCategory1
export const reqCategory3List = (category2Id) => req.get(`/admin/product/getCategory3/${category2Id}`)

// 获取三级联动数据 接口： /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
export const reqFindCategoryList = (category1Id,category2Id,category3Id) => req.get(`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`)

// 保存商品数据 接口： /admin/product/saveAttrInfo
export const reqAddOrUpdateAttrInfo = (data) => req({
  url: '/admin/product/saveAttrInfo',
  method: 'post',
  data
})